<script setup>
import {
    Management,
    Promotion,
    UserFilled,
    User,
    Crop,
    EditPen,
    SwitchButton,
    CaretBottom
} from '@element-plus/icons-vue'

import useUserStore from '@/stores/user.js'

const userInfoStore=useUserStore()

//获取用户详细信息、
// const getUserInfo=async()=>{
//     let result=await userInfoService()
//     userInfoStore.setInfo(result.data)
// }
// getUserInfo()

import {useRouter} from 'vue-router'
const router=useRouter()

</script>

<template>
    <el-container class="layout-container">
        <!-- 左侧菜单 -->
        <el-aside width="200px">
            <div class="el-aside__logo"></div>
            <el-menu active-text-color="#ffd04b" background-color="#232323"  text-color="#fff"
                router>
              <el-sub-menu >
                <template #title>
                  <el-icon>
                    <UserFilled />
                  </el-icon>
                  <span>用户管理</span>
                </template>
                <el-menu-item index="/employee/list" >
                  <el-icon>
                    <User />
                  </el-icon>
                  <span>用户列表</span>
                </el-menu-item>
                <el-menu-item index="/employee/save">
                  <el-icon>
                    <Crop />
                  </el-icon>
                  <span>添加用户</span>
                </el-menu-item>
              </el-sub-menu>

              <el-menu-item index="/category/list">
                <el-icon>
                  <EditPen />
                </el-icon>
                <span>分类管理</span>
              </el-menu-item>

              <el-sub-menu >
                <template #title>
                  <el-icon>
                    <UserFilled />
                  </el-icon>
                  <span>菜品管理</span>
                </template>
                <el-menu-item index="/dish/list" >
                  <el-icon>
                    <User />
                  </el-icon>
                  <span>菜品列表</span>
                </el-menu-item>
                <el-menu-item index="/dish/save">
                  <el-icon>
                    <Crop />
                  </el-icon>
                  <span>添加菜品</span>
                </el-menu-item>
              </el-sub-menu>

              <el-menu-item index="/order/list">
                <el-icon>
                  <EditPen />
                </el-icon>
                <span>订单管理</span>
              </el-menu-item>
                <el-sub-menu >
                    <template #title>
                        <el-icon>
                            <UserFilled />
                        </el-icon>
                        <span>套餐管理</span>
                    </template>
                    <el-menu-item index="/combo/list" >
                        <el-icon>
                            <User />
                        </el-icon>
                        <span>套餐列表</span>
                    </el-menu-item>
                    <el-menu-item index="/combo/save">
                        <el-icon>
                            <Crop />
                        </el-icon>
                        <span>添加套餐</span>
                    </el-menu-item>
                </el-sub-menu>
            </el-menu>
        </el-aside>
        <!-- 右侧主区域 -->
        <el-container>
            <!-- 头部区域 -->
            <el-header>
                <div><strong></strong></div>
                <!-- 下拉菜单 -->
                 <!-- command:条目被点击后会触发，在事件函数上可以声明一个参数，接受条目对应地指令 -->

            </el-header>
            <!-- 中间区域 -->
            <el-main>
                <div style="width: 1290px; height: 570px;border: 1px solid red;">
                    <router-view></router-view>
                </div>
            </el-main>
            <!-- 底部区域 -->
            <el-footer></el-footer>
        </el-container>
    </el-container>
</template>

<style lang="scss" scoped>
.layout-container {
    height: 100vh;

    .el-aside {
        background-color: #232323;

        &__logo {
            height: 120px;
            background: url('@/assets/login_title.png') no-repeat center / 120px auto;
        }

        .el-menu {
            border-right: none;
        }
    }

    .el-header {
        background-color: #fff;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .el-dropdown__box {
            display: flex;
            align-items: center;

            .el-icon {
                color: #999;
                margin-left: 10px;
            }

            &:active,
            &:focus {
                outline: none;
            }
        }
    }

    .el-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #666;
    }
}
</style>